const express = require("express");
const multer = require("multer");

const router = express.Router();

const userController = require("../controller/userController");
const userValidor = require("../middleWare/validator/userValidor");

const upload = multer({ dest: "public/" });

router
  .post("/register",userValidor.register, userController.register)
  .post("/login", userValidor.login, userController.login)
  .get("/list", userController.list)
  .post("/headimg", upload.single("file"), userController.headimg);

module.exports = router;
